<#assign t=JspTaglibs["/META-INF/tld/tiles-jsp.tld"] />
<#assign s=JspTaglibs["/META-INF/tld/struts-tags.tld"] />
<@s.url value="" var="cntxpth"/>
<@s.set name="contextPath" value="#cntxpth"  />
<@s.set name="templateName" value="#templateName"/>
<@s.set name="resourcePath">/${contextPath}templates/${templateName}</@s.set>

<@s.form  namespace="/profile" action="applyReassignedGroups" method="POST" theme="simple">
<#assign itemCount = 0>
<@s.set value="groups" var="currentUserGroups"/>
<@s.iterator value="allGroups" var="grp">
    <input id="_applyReassignGroupForm_checked_${grp.id}" type="checkbox"
           <@s.if test="%{#currentUserGroups.contains(#grp)}">
               checked="checked"
           </@s.if>
            <#--checked="${currentUserGroups?seq_contains(grp)?string("checked", "")}"-->
           name="groups[${itemCount}].id" value="${grp.id}" /> <label for="_applyReassignRoleForm_checked_${grp.id}"><@s.property value="name"/></label>
    <#assign itemCount = itemCount+1>
</@s.iterator>

<@s.hidden name="user.id"/>
<@s.submit/>

</@s.form>